package com.partsoft.dits.mq;

import com.partsoft.dits.DataEdgeDescriptor;
import com.partsoft.dits.MonitorIntegrateDescriptor;
import com.partsoft.dits.MonitorStartMode;

public class MQQueueMonitorDescriptor extends BaseMQQueueDescriptor implements
		MonitorIntegrateDescriptor, Cloneable, DataEdgeDescriptor {
	
	private String dataDescriptorId;
	
	private Class<? extends DataEdgeDescriptor> dataClass;

	private MonitorStartMode startMode = MonitorStartMode.AUTO;
	
	private long monitorInterval = DEFAULT_MONITOR_INTERVAL;
	
	private String MessageProcessorClazz;
	
	public MQQueueMonitorDescriptor(){}
	
	public MQQueueMonitorDescriptor(String queueManager, String queueName,
			String description) {
		super(queueManager, queueName, description);
	}

	public MQQueueMonitorDescriptor(String queueManager, String queueName) {
		super(queueManager, queueName);
	}

	public MonitorStartMode getStartMode() {
		return startMode;
	}
	
	public void setStartMode(MonitorStartMode startMode) {
		this.startMode = startMode;
	}

	public long getMonitorInterval() {
		return monitorInterval;
	}
	
	public void setMonitorInterval(long monitorInterval) {
		this.monitorInterval = monitorInterval;
	}
	
	public String getDataDescriptorId() {
		return dataDescriptorId;
	}

	public void setDataDescriptorId(String dataDescriptorId) {
		this.dataDescriptorId = dataDescriptorId;
	}

	public Class<? extends DataEdgeDescriptor> getDataClass() {
		return dataClass;
	}

	public void setDataClass(Class<? extends DataEdgeDescriptor> dataClass) {
		this.dataClass = dataClass;
	}
	
	public String getMessageProcessorClazz() {
		return MessageProcessorClazz;
	}

	public void setMessageProcessorClazz(String messageProcessorClazz) {
		MessageProcessorClazz = messageProcessorClazz;
	}

	@Override
	public MQQueueMonitorDescriptor clone() {
		return (MQQueueMonitorDescriptor) super.clone();
	}

	public String getMessageCode() {
		throw new IllegalStateException("不支持。");
	}
	
	public String getDataIdentityPrefix() {
		return null;
	}

	@Override
	public String toString() {
		return "MQ队列监听描述符 [dataDescriptorId=" + dataDescriptorId + ", dataClass=" + dataClass
				+ ", startMode=" + startMode + ", monitorInterval=" + monitorInterval + ", MessageProcessorClazz="
				+ MessageProcessorClazz + "]";
	}

}
